﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter13.Code07
{
    using System.Timers;

    public class Demo
    {
        public static void Begin()
        {

        }

        private static void ProecssEvent(object source, EventArgs e)
        {
            if (e is MessageArriveEventArgs)
            {
                Console.WriteLine("Connection.MessageArrived event received.");
                Console.WriteLine("Message: {0}", (e as MessageArriveEventArgs).Message);
            }
            if (e is ElapsedEventArgs)
            {
                Console.WriteLine("Timer.Elapsed event received.");
                Console.WriteLine("SignalTime: {0}", (e as ElapsedEventArgs).SignalTime);
            }
        }
    }
}
